package com.iflytek.day22;

/**
 * 泛型类
 */
class Generic<T> {
  private T t;

  public T getT() {
    return t;
  }

  public void setT(T t) {
    this.t = t;
  }
}

/**
 * 测试类
 */
public class _01_GenericDemo {
  public static void main(String[] args) {
    Generic<String> g1 = new Generic<String>();
    g1.setT("杨幂");
    System.out.println(g1.getT());

    Generic<Integer> g2 = new Generic<Integer>();
    g2.setT(30);
    System.out.println(g2.getT());

    Generic<Boolean> g3 = new Generic<Boolean>();
    g3.setT(true);
    System.out.println(g3.getT());
  }
}
